package com.martini.satoken01.config;

import com.martini.satoken01.service.*;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author martini at 2021/12/18 22:02
 */
@SpringBootConfiguration
public class CacheConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public LimitInfoCacheService limitInfoCacheService(RedisTemplate<String, Object> redisTemplate) {
        return new RedisLimitInfoCacheServiceImpl(redisTemplate);
    }
    @Bean
    @ConditionalOnMissingBean
    public LoginInfoCacheService loginInfoCacheService(RedisTemplate<String, Object> redisTemplate) {
        return new RedisLoginInfoCacheServiceImpl(redisTemplate);
    }
}
